package com.itheima.mapper;

import com.itheima.pojo.Student;
import org.apache.ibatis.annotations.*;

import java.util.List;
import java.util.Map;

@Mapper
public interface StudentMapper {

    //学员列表查询
    List<Student> list(String name, Integer degree, Integer classId);

    //删除学员
    void delete(Integer[] ids);

    //添加学员
    void insertStu(Student student);

    //根据ID查询学员
    Student findById(Integer id);

    //修改学员
    void update(Student student);

    //统计学员学历
    @MapKey("name")
    List<Map<String, Object>> countStuDegree();

    //班级人数统计
    @MapKey("cname")
    List<Map<String, Object>> stuCount();

}
